--流程控制 if while repeat

--if
a = 10
if (a < 10) then
    print("a<10")
elseif a == 12 then
    print("a==2")
elseif a == 13 then
    print("a==13")
else
    print("a>=10")
end

--while
i, sum = 0, 0
while i < 4 do
    i = i + 1
    sum = sum + i
end
print("1+2+3+4", sum)

--跳出循环 没有continue
i, sum = 0, 0
while i < 4 do
    if(i>2) then
        break
    end
    i = i + 1
    sum = sum + i
end
print("1+2+3", sum)

--repeat
i,sum=0,0
repeat
    i=i+1
    sum=sum+i
until i>=4
print("1+2+3+4",sum)


